home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / syncrnet / sc19.zip / SC.ZIP / SYNCREG.C < prev    next >
C/C++ Source or Header  |  1996-04-26  |  18KB  |  593 lines

  1. /* SYNCREG.C - Source code for SyncRegistry 1.0.
  2.      Taken from SyncChat - that's why some code may seem weird, I didn't change
  3.      the variables around or anything, I just left it the way it was.
  4.      Created: 4-24-96 by Prophet (AKA Garry Dolley)
  5.  
  6.      Ok, this is PUBLIC DOMAIN.  You can change it any way you want and
  7.    distribute it.  You can sell it for all I care ;)  It'd be nice although
  8.    if you gave me (Prophet) some credit for making the original version.
  9.  
  10.      If you make something really cool out of this, let me know, I may add
  11.      support for it in SyncChat :)
  12.      Reach me on Dragonspear Castle BBS (818-240-9102 or 818-240-0318)
  13.  
  14.    BTW, I have compiled this with XSDK 2.41 without any problems.
  15.  
  16.    -Prophet
  17. */
  18.  
  19. #include "xsdk.h"
  20.  
  21. struct registry_struct {
  22. uint  user_num;
  23. char  name[31],
  24.             sex,
  25.             age[3],
  26.             city_state[31],
  27.             fav_movie[31],
  28.             music[41],
  29.             fav_tvshows[41],
  30.             fav_foods[31],
  31.             instruments[21],
  32.             fav_sports[41],
  33.             hobbies[51],
  34.             general_info[5][71],
  35.             comment[41];
  36. };
  37.  
  38. struct registry_struct reg, r_temp, r_temp_2;
  39.  
  40.  char *l64, *l65, *l66, *l67, *l68, *l69, *l70, *l71, *l72, *l73, *l74,
  41.                         *l75, *l76, *l77, *l78, *l79, *l80, *l81, *l82, *l83, *l84, *l85,
  42.                         *l86, *l87, *l88, *l89, *l90, *l91, *l92, *l93, *l94, *l95, *l96,
  43.                         *l97, *l98, *l99, *l100, *l101, *l102, *l103, *l104, *l105,
  44.                         *l106;
  45. /* Yeah yeah.. I know these should have been arrays of 'l', but it's a long
  46.      story... ;) */
  47.  
  48. void extended_info(void);
  49. void flush_vars(struct registry_struct *reg);
  50.  
  51. void main(void)
  52. {
  53.   char s[256], str[256], reg_file[256], *p;
  54.     short done = 0, i = 0, n = 0, edit_only = 0, num, feof = 0,
  55.         recs_on_screen = 0, total_recs = 0, cur_rec = 0, match = 0;
  56.     int fp;
  57.     long offset;
  58.     struct registry_struct r_tmp;
  59.  
  60.     /* Start up code ... */
  61.     p=getenv("SBBSNODE");
  62.         if(p)
  63.             strcpy(node_dir,p);
  64.         else {
  65.             printf("\nSBBSNODE environment variable must be set\n");
  66.             exit(0); }
  67.  
  68.     if(node_dir[strlen(node_dir)-1]!='\\')
  69.         strcat(node_dir,"\\");
  70.     initdata();
  71.  
  72.     /* Load up all the strings */
  73.     l64 = (char *) MALLOC(256);
  74.     l65 = (char *) MALLOC(256);
  75.     l66 = (char *) MALLOC(256);
  76.     l67 = (char *) MALLOC(256);
  77.     l68 = (char *) MALLOC(256);
  78.     l69 = (char *) MALLOC(256);
  79.     l70 = (char *) MALLOC(256);
  80.     l71 = (char *) MALLOC(256);
  81.     l72 = (char *) MALLOC(256);
  82.     l73 = (char *) MALLOC(256);
  83.     l74 = (char *) MALLOC(256);
  84.     l75 = (char *) MALLOC(256);
  85.     l76 = (char *) MALLOC(256);
  86.     l77 = (char *) MALLOC(256);
  87.     l78 = (char *) MALLOC(256);
  88.     l79 = (char *) MALLOC(256);
  89.     l80 = (char *) MALLOC(256);
  90.     l81 = (char *) MALLOC(256);
  91.     l82 = (char *) MALLOC(256);
  92.     l83 = (char *) MALLOC(256);
  93.     l84 = (char *) MALLOC(256);
  94.     l85 = (char *) MALLOC(256);
  95.     l86 = (char *) MALLOC(256);
  96.     l87 = (char *) MALLOC(256);
  97.     l88 = (char *) MALLOC(256);
  98.     l89 = (char *) MALLOC(256);
  99.     l90 = (char *) MALLOC(256);
  100.     l91 = (char *) MALLOC(256);
  101.     l92 = (char *) MALLOC(256);
  102.     l93 = (char *) MALLOC(256);
  103.     l94 = (char *) MALLOC(256);
  104.     l95 = (char *) MALLOC(256);
  105.     l96 = (char *) MALLOC(256);
  106.     l97 = (char *) MALLOC(256);
  107.     l98 = (char *) MALLOC(256);
  108.     l99 = (char *) MALLOC(256);
  109.     l100 = (char *) MALLOC(256);
  110.   l101 = (char *) MALLOC(256);
  111.   l102 = (char *) MALLOC(256);
  112.   l103 = (char *) MALLOC(256);
  113.     l104 = (char *) MALLOC(256);
  114.     l105 = (char *) MALLOC(256);
  115.     l106 = (char *) MALLOC(256);
  116.  
  117.     strcpy(l64, "\1n\1gSelection: \1h\1w");
  118.     strcpy(l65, "\1nNo profiles exist yet!  Why not add yours?\r\n");
  119.     strcpy(l66, "\1h\1w### Name                          Comment\r\n");
  120.     strcpy(l67, "\1h\1b-------------------------------------------------------------------------------\r\n");
  121.     strcpy(l68, "\1h\1c%-3s \1n\1g%-29s \1h\1y%s\r\n");
  122.     strcpy(l69, "\1h\1cEnter \1h\1wQ \1h\1cTo Quit, \1h\1wENTER \1cTo Continue, Or A \1wNumber \1cTo View: \1w");
  123.     strcpy(l70, "\1h\1b[\1m%i \1cof \1m%i\1b]\r\n");
  124.     strcpy(l71, "\1h\1cPress \1w[ \1cFor Previous Record, \1w] \1cFor Next Record, Or \1wQ \1cTo Quit: ");
  125.     strcpy(l72, "\1n\1gProfile Information For \1h\1w%s\r\n");
  126.     strcpy(l73, "\1h\1cEnter your handle or real name\r\n");
  127.     strcpy(l74, "\1h\1cAge: ");
  128.     strcpy(l75, "\1h\1cDescribe the type of music/bands you like\r\n");
  129.     strcpy(l76, "\1h\1cWhat is your favorite movie?\r\n");
  130.     strcpy(l77, "\1h\1cWhat is/are your favorite TV show(s)?\r\n");
  131.     strcpy(l78, "\1h\1cWhat kinds of food do you like?\r\n");
  132.     strcpy(l79, "Do you play any instruments");
  133.     strcpy(l80, "\1h\1cWhich one(s)\r\n");
  134.     strcpy(l81, "\1h\1cWhat are your favorite sports?\r\n");
  135.     strcpy(l82, "\1h\1cWhat are your hobbies?\r\n");
  136.     strcpy(l83, "\1h\1cYou now get 5 lines to write whatever you'd like\r\n");
  137.     strcpy(l84, "\1h\1c(Describe yourself, babble, etc...)\r\n");
  138.     strcpy(l85, "\1h\1cEnter a short comment to everyone.\r\n");
  139.     strcpy(l86, "\1h\1cIt will be listed along with your name in short profile listings\r\n");
  140.     strcpy(l87, "\1h\1bWriting profile...\r\n");
  141.     strcpy(l88, "\1h\1cDone!\r\n");
  142.     strcpy(l89, "\1h\1wThanks for taking the time to add your profile to the registry!\r\n");
  143.     strcpy(l90, "\1h\1wOk, here's the info for \1n\1g%s\1h\1w...\r\n");
  144.     strcpy(l91, "\1nHandle/Real Name: \1h\1c%-30s \1nSex: \1h\1c%c \1nAge: \1h\1c%s\r\n");
  145.     strcpy(l92, "\1nCity/State: \1h\1c%s\r\n");
  146.     strcpy(l93, "\1nFavorite Movie: \1h\1c%s\r\n");
  147.     strcpy(l94, "\1nFavorite TV Show(s): \1h\1c%s\r\n");
  148.     strcpy(l95, "\1nFavorite Music/Bands: \1h\1c%s\r\n");
  149.     strcpy(l96, "\1nInstrument(s) Played: \1h\1c%s\r\n");
  150.     strcpy(l97, "\1nFavorite Foods: \1h\1c%s\r\n");
  151.     strcpy(l98, "\1nFavorite Sports: \1h\1c%s\r\n");
  152.     strcpy(l99, "\1nHobbies: \1h\1c%s\r\n");
  153.     strcpy(l100, "\1nGeneral Info (5 Lines):\1h\1c\r\n");
  154.     strcpy(l101, "%s\r\n");
  155.     strcpy(l102, "%s\r\n");
  156.     strcpy(l103, "%s\r\n");
  157.     strcpy(l104, "%s\r\n");
  158.     strcpy(l105, "%s\r\n");
  159.     strcpy(l106, "\1nComment: \1h\1c%s\r\n");
  160.  
  161.     do {
  162.         if(fexist("REGISTRY.ASC"))
  163.             {
  164.             if(fexist("REGISTRY.ANS") && (user_misc&ANSI))
  165.                 printfile("REGISTRY.ANS");
  166.             else
  167.                 printfile("REGISTRY.ASC");
  168.             }
  169.         else if(fexist("REGISTRY.ANS") && (user_misc&ANSI))
  170.             printfile("REGISTRY.ANS");
  171.         else {
  172.             cls();
  173.             bprintf("\1h\1ySyncRegistry v1.0 (\1n\1yXSDK v%s\1h\1y) \1nby Prophet - \1h\1wFREEWARE\r\n", xsdk_ver);
  174.             CRLF;
  175.             bprintf("\1h\1c[\1wL\1c] List Profiles (Short)\r\n");
  176.             bprintf("\1h\1c[\1wE\1c] List Profiles (Long) \r\n");
  177.             bprintf("\1h\1c[\1wA\1c] Add/Edit Your Profile\r\n");
  178.       bprintf("\1h\1c[\1wS\1c] Look Up A Profile By Name\r\n");
  179.             if(user_level >= 90)
  180.                 bprintf("\1n\1c[\1wD\1c] Delete A Profile (Ops Only)\r\n");
  181.             bprintf("\1h\1c[\1wQ\1c] Quit\r\n");
  182.             CRLF;
  183.             }
  184.         bputs(l64);
  185.     switch(getkeys("LEASDQ\r", 0)) {
  186.             case 'L':
  187.                 if(!fexist("REGISTRY.DAT"))
  188.                     {
  189.                     CRLF;
  190.                     bputs(l65); CRLF;
  191.                     pause();
  192.                     break;
  193.                     }
  194.                 n = 1;
  195.                 flush_vars(®);
  196.                 do
  197.                     {
  198.                     cls();
  199.                     bputs(l66);
  200.                     bputs(l67);
  201.                     fp = nopen("REGISTRY.DAT", O_RDONLY);
  202.                     if(fp == -1)
  203.                         {
  204.                         perror("Error [REGISTRY.DAT]");
  205.                         bprintf("\r\nError loading REGISTRY.DAT for read, please inform the SysOp!");
  206.                         break;
  207.                         }
  208.           lseek(fp, sizeof(struct registry_struct) * (n - 1), SEEK_SET);
  209.           recs_on_screen = 0;
  210.                     for(i = 0;
  211.                             ((read(fp, ®, sizeof(struct registry_struct)) != 0) &&
  212.               i < 19); n++)
  213.                         {
  214.                         i++;
  215.                         itoa(n, s, 10);
  216.             bprintf(l68, s, reg.name, reg.comment);
  217.             recs_on_screen++;
  218.                         }
  219.                     feof = eof(fp);
  220.                     close(fp);
  221.                     CRLF;
  222.                     bputs(l69);
  223.                     num = getnum(n - 1);
  224.           if(num == -1)
  225.                         {
  226.                         CRLF;
  227.                         break;
  228.                         }
  229.                     if(num == 0)
  230.                         {
  231.             if(feof)
  232.               {
  233.               CRLF;
  234.               break;
  235.               }
  236.                         continue;
  237.             }
  238.                     fp = nopen("REGISTRY.DAT", O_RDONLY);
  239.                     if(fp == -1)
  240.                         {
  241.                         perror("Error [REGISTRY.DAT]");
  242.                         bprintf("\r\nError opening REGISTRY.DAT for read, please inform the SysOp!");
  243.                         break;
  244.                         }
  245.                     offset = (num - 1) * sizeof(struct registry_struct);
  246.                     lseek(fp, offset, SEEK_SET);
  247.                     read(fp, ®, sizeof(struct registry_struct));
  248.                     close(fp);
  249.           extended_info();
  250.                     CRLF;
  251.           pause();
  252.           feof = 0;
  253.           n = n - recs_on_screen;
  254.           } while(!feof);
  255.         break;
  256.             case 'E':
  257.                 if(!fexist("REGISTRY.DAT"))
  258.                     {
  259.                     bprintf(l65);
  260.           CRLF;
  261.                     pause();
  262.                     break;
  263.                     }
  264.         n = 0; i = 0;
  265.                 do {
  266.           fp = nopen("REGISTRY.DAT", O_RDONLY);
  267.                     if(fp == -1)
  268.             {
  269.             perror("Error [REGISTRY.DAT]");
  270.                         bprintf("\r\nError loading REGISTRY.DAT for read, please inform the SysOp!");
  271.             break;
  272.             }
  273.           total_recs = filelength(fp) / ((long) sizeof(struct registry_struct));
  274.           lseek(fp, sizeof(struct registry_struct) * n, SEEK_SET);
  275.           cur_rec = tell(fp) / sizeof(struct registry_struct);
  276.           read(fp, ®, sizeof(struct registry_struct));
  277.           close(fp);
  278.           extended_info();
  279.                     CRLF;
  280.           bprintf(l70, cur_rec + 1, total_recs, n);
  281.                     bputs(l71);
  282.                     switch(getkeys("][Q",0)) {
  283.             case '[':
  284.               n--;
  285.                             if(n < 0)
  286.                 n = 0;
  287.                             break;
  288.             case ']':
  289.               n++;
  290.                             if(n + 1> total_recs)
  291.                 n = total_recs - 1;
  292.               break;
  293.             case 'Q':
  294.               i = 1;
  295.               CRLF;
  296.               break;
  297.            }
  298.          } while(!i);  
  299.                 break;
  300.             case 'A':
  301.                 if(fexist("REGISTRY.DAT"))
  302.                     {
  303.                     fp = nopen("REGISTRY.DAT", O_RDONLY);
  304.                     for(i = 0; read(fp, ®, sizeof(struct registry_struct)) != 0; i++)
  305.                         {
  306.                         if(reg.user_num == user_number)
  307.                             {
  308.                             edit_only = 1;
  309.                             offset = tell(fp);
  310.                             break;
  311.                             }
  312.                         else
  313.               {
  314.                             edit_only = 0;
  315.                             flush_vars(®);
  316.               }
  317.                         }
  318.                     close(fp);
  319.                     }
  320.                 else
  321.                     {
  322.                     edit_only = 0;
  323.                     flush_vars(®);
  324.           }
  325.  
  326.                 reg.user_num = user_number;
  327.                 strcpy(reg.city_state, user_location);
  328.                 reg.sex = user_sex;
  329.                 cls();
  330.                 bprintf(l72, user_name);
  331.         CRLF;
  332.         bputs(l73);
  333.                 getstr(reg.name, 30, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE); CRLF;
  334.         bputs(l74);
  335.         getstr(reg.age, 2, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE|K_NUMBER); CRLF;
  336.         bputs(l75);
  337.         getstr(reg.music, 40, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE); CRLF;
  338.         bputs(l76);
  339.                 getstr(reg.fav_movie, 30, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE); CRLF;
  340.         bputs(l77);
  341.                 getstr(reg.fav_tvshows, 40, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE); CRLF;
  342.                 bputs(l78);
  343.                 getstr(reg.fav_foods, 30, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE); CRLF;
  344.         if(yesno(l79))
  345.                     {
  346.                     CRLF;
  347.                     bputs(l80);
  348.                     getstr(reg.instruments, 20, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE);
  349.                     }
  350.                 else
  351.                     strcpy(reg.instruments, "None");
  352.                 CRLF;
  353.         bputs(l81);
  354.                 getstr(reg.fav_sports, 40, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE); CRLF;
  355.         bputs(l82);
  356.                 getstr(reg.hobbies, 50, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE); CRLF;
  357.         bputs(l83);
  358.         bputs(l84);
  359.                 getstr(reg.general_info[0], 70, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE);
  360.                 getstr(reg.general_info[1], 70, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE);
  361.                 getstr(reg.general_info[2], 70, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE);
  362.                 getstr(reg.general_info[3], 70, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE);
  363.                 getstr(reg.general_info[4], 70, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE);
  364.                 CRLF;
  365.                 bputs(l85);
  366.         bputs(l86);
  367.                 getstr(reg.comment, 40, K_LOWPRIO|K_EDIT|K_AUTODEL|K_LINE);
  368.  
  369.         if(edit_only)
  370.                     fp = nopen("REGISTRY.DAT", O_WRONLY|O_CREAT);
  371.         if(!edit_only) /* Try to find an 'empty' space */
  372.           {
  373.           fp = nopen("REGISTRY.DAT", O_RDWR|O_CREAT);
  374.           while(!eof(fp)) {
  375.             read(fp, &r_tmp, sizeof(struct registry_struct));
  376.             if(r_tmp.name[0] == 0) /* Found Empty spot */
  377.               {
  378.               offset = tell(fp);
  379.                             offset = offset - sizeof(struct registry_struct);
  380.               lseek(fp, offset, SEEK_SET);
  381.                             break;
  382.                             }
  383.             }
  384.           }
  385.                 if(fp == -1)
  386.                     {
  387.                     perror("Error [REGISTRY.DAT]");
  388.                     bprintf("\r\nError opening REGISTRY.DAT for writing, please inform the SysOp!");
  389.                     break;
  390.                     }
  391.                 if(edit_only)
  392.                     {
  393.                     offset = offset - sizeof(struct registry_struct);
  394.                     lseek(fp, offset, SEEK_SET);
  395.                     }
  396.                 write(fp, ®, sizeof(struct registry_struct));
  397.                 close(fp);
  398.                 CRLF;
  399.                 bputs(l87);
  400.         bputs(l88);
  401.                 CRLF;
  402.                 if(!edit_only)
  403.                     {
  404.           bputs(l89); CRLF;
  405.                     }
  406.                 pause();
  407.                 break;
  408.       case 'S':
  409.         CRLF;
  410.         bputs("\1h\1cEnter Name To Look Up: ");
  411.         if(!getstr(str, 45, K_LOWPRIO|K_LINE|K_UPRLWR))
  412.           break;
  413.         if(!fexist("REGISTRY.DAT"))
  414.           {
  415.           bputs("\r\n\1nNo Profiles Exist To Look Up!\r\n\r\n");
  416.           pause();
  417.           break;
  418.           }
  419.         fp = nopen("REGISTRY.DAT", O_RDONLY);
  420.         if(fp == -1)
  421.           {
  422.           perror("Error [REGISTRY.DAT]");
  423.           CRLF;
  424.           pause();
  425.           break;
  426.           }
  427.         do {
  428.           read(fp, ®, sizeof(struct registry_struct));
  429.           if(strcmpi(reg.name, str) == 0) /* Match */
  430.             {
  431.             match = 1;
  432.             break;
  433.             }
  434.           else
  435.             match = 0;
  436.           } while(!eof(fp));
  437.         close(fp);
  438.         if(match)
  439.           {
  440.           extended_info();
  441.           CRLF;
  442.           pause();
  443.           }
  444.         else
  445.           {
  446.           bprintf("\r\n\1nProfile Not Found.\r\n\r\n");
  447.           pause();
  448.           }
  449.         break;
  450.             case 'D':
  451.                 if(user_level < 90)
  452.                     break;
  453.                 if(!fexist("REGISTRY.DAT"))
  454.                     {
  455.           CRLF;
  456.           bputs(l65);
  457.           CRLF;
  458.                     pause();
  459.                     return;
  460.                     }
  461.                     n = 1;
  462.                     do
  463.                         {
  464.                         cls();
  465.             bprintf(l66);
  466.             bprintf(l67);
  467.                         fp = nopen("REGISTRY.DAT", O_RDONLY);
  468.                         if(fp == -1)
  469.                             {
  470.                             perror("Error [REGISTRY.DAT]");
  471.                             CRLF;
  472.                             pause();
  473.               break;
  474.                             }
  475.                         lseek(fp, sizeof(struct registry_struct) * (n - 1), SEEK_SET);
  476.                         recs_on_screen = 0;
  477.                         for(i = 0;
  478.                              ((read(fp, &r_temp, sizeof(struct registry_struct)) != 0) &&
  479.                              i < 20); n++)
  480.                              {
  481.                              i++;
  482.                              itoa(n, s, 10);
  483.                              bprintf("\1h\1c%-3s \1n\1g%-29s \1h\1y%s\r\n", s, r_temp.name, r_temp.comment);
  484.                              recs_on_screen++;
  485.                              }
  486.                         feof = eof(fp);
  487.                         close(fp);
  488.                         CRLF;
  489.                         bprintf("\1h\1cEnter \1h\1wQ \1h\1cTo Quit, \1h\1wENTER \1cTo Continue, Or A \1wNumber \1cTo Delete: \1w");
  490.                         num = getnum(n - 1);
  491.                         if(num == -1)
  492.                             {
  493.                             CRLF;
  494.                             break;
  495.                             }
  496.                         if(num == 0)
  497.                             {
  498.                             if(feof)
  499.                                 {
  500.                                 CRLF;
  501.                                 break;
  502.                                 }
  503.                             continue;
  504.                             }
  505.                         fp = nopen("REGISTRY.DAT", O_RDWR);
  506.                         if(fp == -1)
  507.                             {
  508.                             perror("Error [REGISTRY.DAT]");
  509.                             bprintf("\r\nError opening REGISTRY.DAT for read, please inform the SysOp!");
  510.                             break;
  511.                             }
  512.                         offset = (num - 1) * sizeof(struct registry_struct);
  513.                         lseek(fp, offset, SEEK_SET);
  514.                         flush_vars(&r_temp); /* Blank out and write */
  515.                         write(fp, &r_temp, sizeof(struct registry_struct));
  516.                         /* Pack REGISTRY.DAT... */
  517.                         while(!eof(fp)) {
  518.                             offset = tell(fp);
  519.                             read(fp, &r_temp, sizeof(struct registry_struct));
  520.                             lseek(fp, (offset - sizeof(struct registry_struct)), SEEK_SET);
  521.                             write(fp, &r_temp, sizeof(struct registry_struct));
  522.                             read(fp, &r_temp, sizeof(struct registry_struct));
  523.                             /* ^^ value not used, function called just to seek */
  524.                             }
  525.                         /* Clip end of file */
  526.                         if(chsize(fp, (filelength(fp) - sizeof(struct registry_struct))) != 0)
  527.                             {
  528.                             perror("Error");
  529.                             CRLF;
  530.                             pause();
  531.                             }
  532.                         close(fp);
  533.                         feof = 1;
  534.                         n = n - recs_on_screen;
  535.                     } while(!feof);
  536.                 break;
  537.             case 'Q':
  538.                 done = 1;
  539.                 break;
  540.             case '\r':
  541.                 done = 1;
  542.                 break;
  543.             }
  544.         lncntr = 0; /* Reset pause */
  545.         } while(!done);
  546. }
  547.  
  548. void extended_info(void)
  549. {
  550.   cls();
  551.   bprintf(l90, reg.name);
  552.     CRLF;
  553.   bprintf(l91,
  554.           reg.name, reg.sex, reg.age);
  555.     bprintf(l92, reg.city_state);
  556.     bprintf(l93, reg.fav_movie);
  557.     bprintf(l94, reg.fav_tvshows);
  558.     bprintf(l95, reg.music);
  559.     bprintf(l96, reg.instruments);
  560.     bprintf(l97, reg.fav_foods);
  561.     bprintf(l98, reg.fav_sports);
  562.     bprintf(l99, reg.hobbies);
  563.     bprintf(l100);
  564.     bprintf(l101, reg.general_info[0]);
  565.     bprintf(l102, reg.general_info[1]);
  566.     bprintf(l103, reg.general_info[2]);
  567.     bprintf(l104, reg.general_info[3]);
  568.     bprintf(l105, reg.general_info[4]);
  569.     bprintf(l106, reg.comment);
  570. }
  571.  
  572. void flush_vars(struct registry_struct *reg)
  573. {
  574.     memset(reg->name, 0, 31);
  575.     memset(reg->age, 0, 3);
  576.   memset(reg->city_state, 0, 31);
  577.   memset(reg->fav_movie, 0, 31);
  578.   memset(reg->music, 0, 41);
  579.   memset(reg->fav_tvshows, 0, 41);
  580.   memset(reg->fav_foods, 0, 31);
  581.   memset(reg->instruments, 0, 21);
  582.   memset(reg->fav_sports, 0, 41);
  583.   memset(reg->hobbies, 0, 51);
  584.     memset(reg->general_info[0], 0, 71);
  585.   memset(reg->general_info[1], 0, 71);
  586.   memset(reg->general_info[2], 0, 71);
  587.   memset(reg->general_info[3], 0, 71);
  588.   memset(reg->general_info[4], 0, 71);
  589.   memset(reg->comment, 0, 41);
  590.   reg->sex = ' ';
  591.   reg->user_num = 0;
  592. }
  593.